#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
};




/**
 * @brief 帧结构体，每个帧进行统一描述
 *
 */
typedef struct Frame_DATA{

   unsigned char kernel_add;
   unsigned char fun_code;
   unsigned char start_add;
   unsigned char CRC[2];


   char * name;
   int size;//size除以2就是数据寄存器的数量
   int data[32];

}Frame_DATA_t,*Frame_DATA_p;




/**
 * @brief 环形缓冲区结构体，所有帧统一注册进来
 *
 */
struct buffer {
    Frame_DATA_t Frame_DATA[BUFFER_SIZE];
    int read_pos, write_pos, size;
    pthread_mutex_t mutex;
    pthread_cond_t not_empty, not_full;
};





#endif // MAINWINDOW_H
